<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/css/style_int.css">
<script src="<%= request.getContextPath() %>/jscripts/jscripts.js" type="text/javascript"></script>
<body onload="reSize()">
	<table width="100%" border="0" cellpadding="0" cellspacing="1" background="url(../images/fond_page.png)" style="border: 1px solid #73802E;font-size:12px;font-family:Verdana;">
		<tr>
			<td height="25" align="center" class="td_head">Cantidad</td>
			<td align="center" class="td_head">Descripci&oacute;n</td>
			<td align="center" class="td_head">Precio Unitario</td>
			<td align="center" class="td_head">Subtotal</td>
			<td align="center" class="td_head"></td>
		</tr>
		<c:set var="cantidad" value="0"></c:set>
		<c:forEach var="prod" items="${objBPedido.detallePedido}">
			<c:set var="cantidad" value="${cantidad+1}"></c:set>
			<tr>
				<td height="25" align="center">${prod.cantidad}</td>
				<td align="center">${prod.producto.descripcion}</td>
				<td align="center">S/. ${prod.producto.precioUnitario}</td>
				<td align="center">S/. ${prod.cantidad*prod.producto.precioUnitario}</td>
				<td align="center">
					<input type="button" class="btn_editar" onclick="JavaScript:parent.document.location.href='<%= request.getContextPath() %>/SPedido?accion=3&id=${prod.codigoDetalle}'">
					<input type="button" class="btn_eliminar" onclick="JavaScript:document.location.href='<%= request.getContextPath() %>/SPedido?accion=2&id=${prod.codigoDetalle}'">
				</td>
			</tr>
		</c:forEach>
	</table>
	<br>
	<table style="font-size:12px;font-family:Verdana;width: 100%">
		<tr>
			<td height="23" align="center">
				SubTotal S/. <input id="subTotal" readonly="readonly" style="width: 90px" type="text" value="${objBPedido.subTotal}"> &nbsp; 
				IGV S/. <input id="subTotal" readonly="readonly" style="width: 90px" type="text" value="${objBPedido.igv}"> &nbsp; 
				Total S/. <input id="subTotal" readonly="readonly" style="width: 90px" type="text" value="${objBPedido.total}">
			</td>
		</tr>
	</table>
	
</body>
<script type="text/javascript">

function reSize(){
	if('${cantidad}' != '0'){
		try{
			  var iframe = parent.document.getElementById("frm_listadoProducto");
			  var innerDoc = (iframe.contentDocument) ? iframe.contentDocument : iframe.contentWindow.document;
		      if (innerDoc.body.offsetHeight){//ns6 syntax
		         iframe.height = 26*${cantidad} + 80; //Extra height FireFox
		      }
		      else if (iframe.Document && iframe.Document.body.scrollHeight){//ie5+ syntax
		         iframe.height = iframe.Document.body.scrollHeight;
		      }
		    }catch(err){
		      alert(err.message);
		    }
	}
}
</script>
</html>
